
import {request} from './myRequest.js'
  // name:'德格藏医药',
  // id:'1352217944631853057',  categoryFirst

  // name:'善地德格',
  // id:'1352218128409477121',categoryFirst

  // name:'手工艺品',
  // id:'1353731419288924162' categoryFirst

module.exports = {
  request,
  login: (data) => {//小程序登录接口
    return request('POST','/weixin/api/ma/wxuser/login', data)
  },
  findCategory: (data) => {//获取首页二级目录 categoryFirst
    return request('GET','/weixin/api/ma/goodsspu/findNdCategory', data)
  },
   getShoplist:(data)=>{//获取所有商品 categoryFirst categorySecond
    return request('GET','/weixin/api/ma/goodsspu/findCategoryFirstData', data)
   },
   getShopdetail:(data) =>{//获取单个商品详情 categoryFirst categorySecond
    return request('GET','/weixin/api/ma/goodsspu/'+data)
   }, 
  postCollect:(data)=>{ //点击加入购物车  
    // spuId id,
    // addPrice 价格,
    // quantity 数量,
    // spuName 名字,
    // size 尺寸
    return request('POST','/weixin/api/ma/shoppingcart', data)
  },
 clearCollect:(data)=>{ //取消购物车
    // spuId id,
    // addPrice 价格,
    // quantity 数量,
    // spuName 名字,
    // size 尺寸
    return request('POST','/weixin/api/ma/shoppingcart/del', data)
  },
  getCollect:(data)=>{//获取我的购物车
    // kind:'' 就为空
    return request('GET','/weixin/api/ma/shoppingcart/myCollectors',data)
  },
  getCarts:()=>{//获取我的收藏
    return request('GET','/weixin/api/ma/goodsspu/myCollectors')
  },
  postCarts :(data)=>{//收藏商品
    return request('POST','/weixin/api/ma/goodsspu/collectorProduct',data)
  },
  placeOrder: (data) => {//下单
    // spuId: ,
    // quantity:,
    // paymentPrice: 支付价格,
    // size:""
    return request('POST','/weixin/api/ma/orderinfo',data)
  },
  getAddress:()=>{//查询收货地址
    return request('GET','/weixin/api/ma/useraddress/page')
  },
  editAdress:(data)=>{ //修改新增地址
    //   id:"",
    //   userName:姓名,
    //   telNum:电话,
    //   myDress:详细地址,
    //   provinceName:省,
    //   cityName:市,
    //   detailInfo:"",
    //   ifDefault:false
    return request('POST','/weixin/api/ma/useraddress',data)
  },
  deletAdress: (data) => {//删除地址
    // id
    return request('DELETE','/weixin/api/ma/useraddress/'+data)
  },
  getOrder: (data) => {//获取全部订单

    return request('GET','/weixin/api/ma/orderinfo/page',data)
  },
  orderDetail:(data)=>{ //单个订单详情
    return request('GET','/weixin/api/ma/orderinfo/'+data)
  },
  putAddress:(data)=>{  //修改订单地址
    return request('POST','/weixin/api/ma/useraddress/findByAddressId',data)
  },
  putUsermsg:(data)=>{ //修改用户信息
    return request('POST','/weixin/api/ma/wxuser/updateById',data)   
  },
  putPay:(data)=>{ //发起支付
    return request('POST','/weixin/api/ma/orderinfo/pay',data)
  },
  receive:(data)=>{ //确认收货
    return request('PUT','/weixin/api/ma/orderinfo/receive/'+data)
  },
  clearPay:(data)=>{ //取消订单
    return request('PUT','/weixin/api/ma/orderinfo/cancel/'+data)
  },
  deletePay:(data)=>{ //删除订单
    return request('DELETE','/weixin/api/ma/orderinfo/'+data)
  },
  checkLogitic:(data)=>{//查询物流
   return request('GET','/weixin/api/ma/logistics/queryTrack',data)
  },
  getSwiperlist:(data)=>{//获取对应轮播图
    // categoryId:
    return request('GET','/weixin/api/ma/goodsspu/slideshowPage',data)
  },
  upFiles:(data)=>{
    return request('POST','/oss/uploadImg',data)
  }
}